<template>
	<view class="container">
		<view class="topbox">
			<image class="topbg" src="/pages/business/static/mingx.png" mode=""></image>
			<view class="topcon">
				<view class="toptitle">
					账户余额
				</view>
				<view class="qiannum">
					13200.00
				</view>
				<view class="czbox">
					<view class="box_item">
						<view class="" style="font-size: 36rpx;">
							{{allPrice}}
						</view>
						<view class="" style="font-size: 24rpx;">
							金钱总收益
						</view>
					</view>
					<view class="czline">
						
					</view>
					<view class="box_item">
						<view class="" style="font-size: 36rpx;">
							{{allScoreA}}
						</view>
						<view class="" style="font-size: 24rpx;">
							惠值积分总收益
						</view>
					</view>
					<view class="czline">
						
					</view>
					<view class="box_item">
						<view class="" style="font-size: 36rpx;">
							{{allScoreB}}
						</view>
						<view class="" style="font-size: 24rpx;">
							贡献值总收益
						</view>
					</view>
				</view>
			</view>
			
		</view>
		<view class="con">
			<view class="title">
				收益记录
				<view class="tx" @click="clickto('/pages/wallet/withdrawal')">
					提现
				</view>
			</view>
			<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="scrolltolower">
				<view>
					<view class="minxitem" v-for="(item,index) in mxlist" :key="index">
						<image v-if="item.method==0||item.method==1||item.method==2" class="qian_icon" src="/static/img/wallet/qian.png" mode=""></image>
						<image v-if="item.method==3" class="qian_icon" src="/static/img/tongz/zs.png" mode=""></image>
						<image v-if="item.method==4" class="qian_icon" src="/static/img/tongzhi/zs.png" mode=""></image>
						<view class="item_right">
							<view class="right_top">
								<text>{{item.pay_name}}</text>
								<text style="color: #FA4600;font-size: 33rpx;">+{{item.price}}</text>
								<!-- <text v-else style="font-size: 33rpx;">-{{item.money}}</text> -->
							</view>
							<view class="time">
								<!-- {{item.createtime}} -->
								{{$u.timeFormat(item.createtime, 'yyyy-mm-dd hh:MM:ss')}}
							</view>
						</view>
					</view>
					<u-loadmore :status="status" @loadmore="scrolltolower"/>
				</view>
			</scroll-view>
			
		</view>
	</view>
</template>

<script>
	import {getMerchantFinacel} from '@/api/my.js'
	export default {
		data() {
			return {
				mxlist:[],
				page:1,
				last_page:1,
				money:0,
				status:'loadmore',
				allPrice:0,
				allScoreA:0,
				allScoreB:0
			}
		},
		methods: {
			clickto(url){
				uni.$u.route(url);
			},
			getdata(){
				getMerchantFinacel({page:this.page}).then(res=>{
					// console.log(res)
					this.status='loadmore'
					this.allScoreB=res.data.data.allScoreB
					this.allScoreA=res.data.data.allScoreA
					this.allPrice=res.data.data.allPrice
					this.last_page=res.data.data.result.last_page
					this.mxlist=[...this.mxlist,...res.data.data.result.data]
				})
			},
			scrolltolower(){
				this.page++
				this.status='loading'
				if(this.page<=this.last_page){
					this.getdata()
				}else{
					this.status='nomore'
				}
			}
		},
		onLoad() {
			this.money=uni.getStorageSync('userinfo').money
			this.getdata()
		}
	}
</script>

<style lang="less">
.container{
	padding: 40rpx 30rpx 20rpx;
	.topbox{
		width: 690rpx;
		height: 344rpx;
		position: relative;
		color: #fff;
		.zzbox{
			position: absolute;
			width: 148rpx;
			line-height: 72rpx;
			background: #FFFFFF;
			border-radius: 36rpx;
			text-align: center;
			font-size: 30rpx;
			color: #F85909;
			top:70rpx;
			right: 44rpx;
		}
		.topbg{
			position: absolute;
			top: 0;
			left: 0;
			width: 690rpx;
			height: 344rpx;
		}
		.topcon{
			height: 344rpx;
			position: absolute;
			top: 0;
		}
		.toptitle{
			font-size: 24rpx;
			padding-top: 57rpx;
			padding-left: 47rpx;
			margin-bottom:20rpx;
		}
		.qiannum{
			font-size: 50rpx;
			// font-weight: bold;
			padding-left: 46rpx;
			font-family: Impact;
		}
		.czbox{
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 582rpx;
			padding: 0 54rpx;
			font-size: 32rpx;
			margin-top: 60rpx;
			.czline{
				width: 2rpx;
				height: 37rpx;
				background: rgba(254, 253, 255, 1);
				opacity: 0.2;
			}
			.czicon{
				width: 42rpx;
				height: 42rpx;
				margin-right: 22rpx;
			}
			.box_item{
				display: flex;
				align-items: center;
				flex-direction: column;
				font-size: 24rpx;
			}
		}
	}
}
.title{
	font-size: 34rpx;
	color: #3F3F3F;
	font-weight: bold;
	margin-top: 44rpx;
	line-height: 40rpx;
	display: flex;align-items: center;justify-content: space-between;
	.tx{
		width: 148rpx;
		line-height: 72rpx;
		background: linear-gradient(100deg, #FD6F27, #F85808);
		border-radius: 36rpx;
		text-align: center;
		font-size: 30rpx;
		color: #fff;
		font-weight: normal;
	}
}
.minxitem{
	display: flex;
	align-items: center;
	padding: 35rpx 0;
	border-bottom: 2rpx solid #F4F5F6;
	.qian_icon{
		width: 76rpx;
		height: 76rpx;
	}
	.item_right{
		padding-right: 20rpx;
		padding-left: 16rpx;
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		
		.right_top{
			display: flex;
			justify-content: space-between;
			color: #333333;
			font-size: 26rpx;
			font-weight: bold;
			align-items: center;
		}
		.time{
			color: #A2A1A0;
			font-size: 24rpx;
		}
	}
}
.scroll-view{ 
	margin-top: 20rpx;
	height: calc(100vh - 40rpx - 44rpx - 344rpx - 40rpx - 20rpx - 44px - 20rpx);
	/* #ifdef MP */
	height: calc(100vh - 40rpx - 44rpx - 344rpx - 40rpx - 20rpx - 20rpx);
	/* #endif */
}
</style>
